from tornado.httpserver import HTTPServer
from tornado.wsgi import WSGIContainer
from app import app
from tornado.ioloop import IOLoop

s = HTTPServer(WSGIContainer(app))
s.listen(8080)  # 监听 8080 端口
IOLoop.current().start()

# 多进程
# s = HTTPServer(WSGIContainer(app))
# s.bind(8081)  # 监听 8081 端口
# s.start(20)  # 使用多进程模式，参数为0表示根据 CPU 核心数创建相应数量的进程
# IOLoop.current().start()
